package com.cdtye.itps.cms;

import com.cdtye.common.codegenecore.CodeGeneratorUtil;
import com.google.common.collect.Lists;

import java.util.List;


/**
 * @Author wzw
 * @Date: 14:04 2023/5/10
 * @Description: 代码生成器
 * @Param
 * @return
**/
public class CodeGenerator {
    /**
     * 创建模块作者
     */
    private static final String CREATE_AUTHOR = "";
    /**
     * 模块父包名
     */
    private static final String PARENT_PACKAGE = "com.cdtye.itps.cms";
    /**
     * 数据源配置
     */
    private static final String URL = "jdbc:oracle:thin:@172.26.1.103:1521:ORCL";
    private static final String DRIVER_NAME = "oracle.jdbc.driver.OracleDriver";
    private static final String USERNAME = "cms_sh_prod";
    private static final String PASSWORD = "cms_sh_prod";
    /**
     * 配置数据库表名
     */
    private static final List<String> TABLE_NAMES = Lists.newArrayList(
             "SYS_DEPT", "SYS_DEPT_JOIN_TYPE","SYS_DEPT_TYPE"
    );

    public static void main(String[] args) {
        //初始化生成参数
        //生成代码目录，项目目录。自定义，当前idea同时打开多项目时使用。
        String projectPath = "D:\\sss";
        //String projectPath = "";
        CodeGeneratorUtil codeModel = new CodeGeneratorUtil(CREATE_AUTHOR, PARENT_PACKAGE, URL, DRIVER_NAME, USERNAME, PASSWORD, projectPath);
        for (String tableName : TABLE_NAMES) {
            //根据表名生成模块代码
            codeModel.generator(tableName);
        }
    }

}
